/**
 * @author dpGroup
 */

package org.doubango.ngn.model.iterator;

import java.util.ArrayList;
import java.util.List;

import org.doubango.ngn.model.NgnEmail;

public class EmailsIterator implements INGNIterator{
	List<NgnEmail> mNgnEmails;
	private int currentIndex = 0;

	public EmailsIterator(List<NgnEmail> mNgnEmails){
		if (mNgnEmails != null) {
			this.mNgnEmails = mNgnEmails;
		} else {
			mNgnEmails = new ArrayList<NgnEmail>();
		}
	}

	@Override
	public boolean hasNext(){
		if (currentIndex >= mNgnEmails.size()) {
			return false;
		} else {
			return true;
		}
	}

	@Override
	public NgnEmail next(){
		NgnEmail ngnEmail = mNgnEmails.get(currentIndex);
		currentIndex++;
		return ngnEmail;
	}

	@Override
	public boolean remove(Object obj){
		return mNgnEmails.remove(obj);
	}

	@Override
	public NgnEmail remove(int ind){
		return mNgnEmails.remove(ind);
	}
}
